{if $parent_category == 0}
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
		<tbody>
			<tr>
				<td class="bgtitle">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" id="abc">
						<tbody>
							<tr>
								<td>
									<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
										<tbody>
											<tr>
												<td width="20">
													<img src="/templates/images/mui_ten.gif"></td>
												<td valign="bottom" class="title">
													<div id="danhmucsanpham">
														<!-- Sửa -->
														<h1 class="addtitle">{$parent.categoryname} {$product[0].categoryname}</h1>
													</div>    
												</td>
												<td width="10" valign="bottom">&nbsp;</td>
											</tr>
										</tbody>
									</table>
								</td>
								<td width="220" valign="bottom" bgcolor="#FFFFFF">
									<table border="0" align="right" cellpadding="0" cellspacing="0">
										<tbody>
											<tr>
												<td>
													<div align="right">Sắp xếp theo:</div>
												</td>   
												<td width="5" valign="bottom" class="title">
													<img src="/templates/images/space.gif" width="5" height="1">
												</td>
												<td valign="bottom" class="title">
													<script language="javascript">
														function getproduct(theprokind)
														{	
															document.location = 'productpage-3-36-0-'+theprokind.value+'-thegioikts.html'
														}
													</script>
													<select name="order" id="order" class="box_input" onchange="getproduct(this)">
														<option value="1" selected="">Giá thấp đến cao </option>
														<option value="2">Giá cao đến thấp</option>
														<option value="3">Xem nhiều</option>
														<option value="0">Mới cập nhật</option>
													</select>
												</td>
											</tr>
										</tbody>
									</table>
								</td>    
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
			<tr>
				<td valign="top">
					<img src="/templates/images/space.gif" width="1" height="10">
				</td>
			</tr>
		</tbody>
	</table>
	<table width="98%" border="0" align="center" height="25" cellpadding="0" cellspacing="0">
		<tbody>
			<tr> 
				<td>Sản phẩm: <strong>1</strong> - <strong>18</strong> trong tổng số: <strong>{$product|@count}</strong> sản phẩm</td>
			</tr>
		</tbody>
	</table>

	<table align="center" border="0" cellpadding="0" cellspacing="0">
		<tbody>

			{foreach from=$product item=product_item}
				{if $product_item@index % 3== 0}
					<tr>
					{/if}
                    <td valign="top">
						<input name="idprocheck[]" type="hidden" value="259">
						<table width="260" border="0" align="center" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td> 
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tbody>
												<tr>
													<td width="11">
														<img src="/templates/images/tbl_pro1.jpg" width="11" height="11">
													</td>
													<td background="/templates/images/tbl_pro2.jpg">
														<img src="/templates/images/tbl_pro2.jpg" width="1" height="11">
													</td>
													<td width="11">
														<img src="/templates/images/tbl_pro3.jpg" width="11" height="11">
													</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tbody>
												<tr>
													<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
													<td>
														<img src="/templates/images/posts.gif">&nbsp;
														<!-- Sửa -->
														<a href="/{$parent.link}" class="linktitlebox">{$parent.categoryname}</a> | 
														<a href="/{$product_item.link}" class="linktitlebox">{$product_item.categoryname}</a>
													{if $promotion_start == 1}
														<span style="float: right; font-weight: bold; margin-top: 2px; color:red">{$promotionbytime.percentdiscount}%</span>
														<img src="/templates/images/sale.png" style="float: right;">
													{/if}
													</td>
													<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
												</tr>
												<tr>
													<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
													<td height="270">
														<div align="center">
															<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
																<tbody>
																	<tr>
																		<td align="left">
																			<!-- Sửa -->
																			<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}"> 
																				<img src="/templates/images/product/{$product_item.image}" alt="{$product_item.productname}" width="180" height="260" border="0"> 
																			</a>
																		</td>
																	</tr>
																</tbody>
															</table>
														</div>
													</td>
													<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
												</tr>
												<tr>
													<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
													<td height="50" valign="top">
														<div align="center">
															<h3 style="margin:0px;">
																<!-- Sửa -->
																<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}" class="linkblack">{$product_item.productname}</a>
															</h3>
															<span class="{if $promotion_start == 1}fontgrayprice{else}fontred{/if}">{$product_item.price|number_format} VNĐ</span>
															<br>
															{if $promotion_start == 1}
																<img src="/templates/images/sale_arrow.png" style="position: absolute; margin-top: -11px; margin-left: -60px;">
																<span class="fontred">{($product_item.price*(100-$promotionbytime.percentdiscount)/100)|number_format} VNĐ</span>
																<br>
															{/if}
															<span class="fontgreen">{$product_item.promotion}</span>
														</div>
													</td>
													<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tbody>
												<tr>
													<td width="11">
														<img src="/templates/images/tbl_pro6.jpg" width="11" height="44"></td>
													<td background="/templates/images/tbl_pro7.jpg" style="padding-bottom:3px">
														<form action="/cart/add/{$product_item.idproduct}" method="post" style="margin:0">
															<table border="0" align="center" cellpadding="2" cellspacing="0">
																<!-- Sửa -->
																<input type="hidden" name="idcth" value="{$product_item.productid}">
																<input type="hidden" name="proname" value="{$product_item.productname}">
																<input type="hidden" name="price" value="{$product_item.price}">
																<input type="hidden" name="poids" value="">
																<input type="hidden" name="img" value="{$product_item.image}">
																<tbody>
																	<tr>
																		<!-- Nút chi tiết  -->
																		<td>
																			<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}">
																				<img src="/templates/images/but-detail.jpg" border="0"></a>
																		</td>
																		<td width="2">
																			<img src="/templates/images/space.gif" width="2">
																		</td>
																		<!--nut mua-->
																		<td>
																			{if ($product_item.inventory - $product_item.quantity_buying) > 0}
																			<input type="image" src="/templates/images/but-book.jpg"></a>
																			{else}
																				<span class="fontred">Hết hàng</span>
																			{/if}
																		</td>
																	</tr>
																</tbody>
															</table>
														</form>
													</td>
													<td width="11">
														<img src="/templates/images/tbl_pro8.jpg" width="11" height="44">
													</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					{if $product_item@index %3 == 2}
					</tr>
				{/if}
			{/foreach}

			<tr>
			</tr>
		</tbody>
	</table>

	<table width="98%" border="0" align="center" height="25" cellpadding="0" cellspacing="0">
		<tbody>
			<tr> 
				<td>Sản phẩm: <strong>1</strong> - <strong>18</strong> trong tổng số: <strong>{$product|@count}</strong> sản phẩm</td>
			</tr>
		</tbody>
	</table>
	<style>
		#danhmucsanpham{
			position: relative;
		}
		h1.addtitle{
			font-size:18px;
			margin:0px;
			display:inline;
		}
		span#titlecategory {
			position: absolute;
			top:-21px;
		}
		#titlecategory a{
			font-size:11px;
		}
	</style>
{else}
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td class="bgtitle">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td>
									<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
										<tbody>
											<tr>
												<td width="20">
													<img src="/templates/images/mui_ten.gif">
												</td>
												<td valign="bottom" class="title">
													<a href="/product/camera" class="linkcat20">Máy ảnh</a>
												</td>
												<td width="10" valign="bottom">&nbsp;</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table> 
				</td>
			</tr>
			<tr>
				<td valign="top">&nbsp;</td>
			</tr>
			<tr>
				<td valign="top">
					<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11">
													<img src="/templates/images/tbl_pro1.jpg" width="11" height="11"></td>
												<td background="/templates/images/tbl_pro2.jpg">
													<img src="/templates/images/tbl_pro2.jpg" width="1" height="11"></td>
												<td width="11">
													<img src="/templates/images/tbl_pro3.jpg" width="11" height="11"></td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11" style="background-image:url(/templates/images/tbl_pro4.jpg); background-repeat:repeat-y; background-position:left top">
													<img src="/templates/images/tbl_pro4.jpg" width="11" height="1"></td>
												<td>
													<div align="center">
														<table width="96%" align="center" border="0" cellspacing="0" cellpadding="0">
															<tbody>
																{foreach from=$category item=category_item}
																	{if $category_item@index % 3== 0}
																		<tr>
																		{/if}
																		<td width="30%" class="submenu22">
																			<a href="/{$category_item.link}" class="linkmn2">{$category_item.categoryname}</a> ({$category_item.quantity})
																		</td>
																		<td width="5%">&nbsp;</td>
																		{if $category_item@index %3 == 2}
																		</tr>
																	{/if}
																{/foreach}														
																<tr>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
												<td width="11" style="background-image:url(/templates/images/tbl_pro5.jpg); background-repeat:repeat-y; background-position:right top">
													<img src="/templates/images/tbl_pro5.jpg" width="11" height="1">
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11">
													<img src="/templates/images/tbl_logo6.jpg" width="11" height="11"></td>
												<td background="/templates/images/tbl_logo7.jpg">
													<img src="/templates/images/tbl_logo7.jpg" width="1" height="11"></td>
												<td width="11">
													<img src="/templates/images/tbl_logo8.jpg" width="11" height="11"></td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>
{/if}